package day05.HomeWork;

import java.util.Random;

/**
 * @description: TODO
 * @author yumo
 * @version: 1.0
 * @date 2025/3/5 20:01
 */
public class Extension {
    public static void main(String[] args) {
        Random rand=new Random();
        int []arr=new int[5];
        for (int i=0;i<arr.length;i++){
            arr[i]=rand.nextInt(10);
            System.out.println(arr[i]);
        }
        System.out.println("ssssssssss");
        int bb=getMaxOfArray(arr);
        System.out.println("返回的最大值"+bb);


        int[] hj={2,3,4,5};
        arrayData(hj);
    }
    public static int getMaxOfArray(int[]arr){
        int aa=arr[0];
        for (int i=1; i<arr.length; i++){
            if (aa<arr[i]){
                aa=arr[i];
            }
        }
        System.out.println("最大值"+aa);
        return aa;
    }
    public static void arrayData(int []arr){
        for (int i=0; i<arr.length; i++){
            System.out.println(arr[i]);
        }
    }
}
